/**
 * ProductListVo.java   2018年4月5日 上午10:32:52 by xuebing 
 *
 * Copyright (c) 2010 - 2018 All rights reserved.
 * 
 */
package com.rongmai.db.vo.admin;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;

public class ProductListVo implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 产品表字段信息
     */
    private Integer id;
    private String productId;
    private String factoryCode;
    private String cnName;
    private String enName;
    private Integer type;
    private String cnDescription;
    private String enDescription;
    private Integer categoryId;
    private String pattern;
    private String unit;
    private Integer origin;
    private Integer material;
    private Integer color;
    private String warehouseArea;
    private Integer minQuantity;
    private Integer amount;
    private Double length;
    private Double width;
    private Double high;
    private Integer productSource;
    private String channel;
    private String year;
    private Integer showFront;
    private BigDecimal marketPrice;
    private BigDecimal costPrice;
    private Integer whetherOrder;
    private Integer status;
    private Date shelfTime;
    private Integer style;
    private Date createTime;
    private Date updateTime;
    private Date publishTime;
    private Boolean isDelete;
    /**
     * 产品图片表字段信息
     */
    private String imgName;
    private String imgUrl;
    private Integer imgWidth;
    private Integer imgHeight;
    /**
     * 扩展字段
     */
    private String name;
    private String colorStr;
    private String OriginStr;
    private String CategoryStr;
    private String warehouseAreaStr;
    private BigDecimal volume;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getFactoryCode() {
        return factoryCode;
    }

    public void setFactoryCode(String factoryCode) {
        this.factoryCode = factoryCode;
    }

    public String getCnName() {
        return cnName;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }

    public String getEnName() {
        return enName;
    }

    public void setEnName(String enName) {
        this.enName = enName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getCnDescription() {
        return cnDescription;
    }

    public void setCnDescription(String cnDescription) {
        this.cnDescription = cnDescription;
    }

    public String getEnDescription() {
        return enDescription;
    }

    public void setEnDescription(String enDescription) {
        this.enDescription = enDescription;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public String getPattern() {
        return pattern;
    }

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Integer getOrigin() {
        return origin;
    }

    public void setOrigin(Integer origin) {
        this.origin = origin;
    }

    public Integer getMaterial() {
        return material;
    }

    public void setMaterial(Integer material) {
        this.material = material;
    }

    public Integer getColor() {
        return color;
    }

    public void setColor(Integer color) {
        this.color = color;
    }

    public String getWarehouseArea() {
        return warehouseArea;
    }

    public void setWarehouseArea(String warehouseArea) {
        this.warehouseArea = warehouseArea;
    }

    public Integer getMinQuantity() {
        return minQuantity;
    }

    public void setMinQuantity(Integer minQuantity) {
        this.minQuantity = minQuantity;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Double getLength() {
        return length;
    }

    public void setLength(Double length) {
        this.length = length;
    }

    public Double getWidth() {
        return width;
    }

    public void setWidth(Double width) {
        this.width = width;
    }

    public Double getHigh() {
        return high;
    }

    public void setHigh(Double high) {
        this.high = high;
    }

    public Integer getProductSource() {
        return productSource;
    }

    public void setProductSource(Integer productSource) {
        this.productSource = productSource;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public Integer getShowFront() {
        return showFront;
    }

    public void setShowFront(Integer showFront) {
        this.showFront = showFront;
    }

    public BigDecimal getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice) {
        this.marketPrice = marketPrice;
    }

    public BigDecimal getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(BigDecimal costPrice) {
        this.costPrice = costPrice;
    }

    public Integer getWhetherOrder() {
        return whetherOrder;
    }

    public void setWhetherOrder(Integer whetherOrder) {
        this.whetherOrder = whetherOrder;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getShelfTime() {
        return shelfTime;
    }

    public void setShelfTime(Date shelfTime) {
        this.shelfTime = shelfTime;
    }

    public Integer getStyle() {
        return style;
    }

    public void setStyle(Integer style) {
        this.style = style;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public Boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Boolean isDelete) {
        this.isDelete = isDelete;
    }

    public String getImgName() {
        return imgName;
    }

    public void setImgName(String imgName) {
        this.imgName = imgName;
    }
    
    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public Integer getImgWidth() {
        return imgWidth;
    }

    public void setImgWidth(Integer imgWidth) {
        this.imgWidth = imgWidth;
    }

    public Integer getImgHeight() {
        return imgHeight;
    }

    public void setImgHeight(Integer imgHeight) {
        this.imgHeight = imgHeight;
    }

    public String getName() {
        if(this.getCnName() != null) {
            return cnName;
        }
        if(this.getEnName() != null) {
            return enName;
        }
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColorStr() {
        return colorStr;
    }

    public void setColorStr(String colorStr) {
        this.colorStr = colorStr;
    }

    public String getOriginStr() {
        return OriginStr;
    }

    public void setOriginStr(String originStr) {
        OriginStr = originStr;
    }

    public String getCategoryStr() {
        return CategoryStr;
    }

    public void setCategoryStr(String categoryStr) {
        CategoryStr = categoryStr;
    }

    public String getWarehouseAreaStr() {
        return warehouseAreaStr;
    }

    public void setWarehouseAreaStr(String warehouseAreaStr) {
        this.warehouseAreaStr = warehouseAreaStr;
    }
    
    public BigDecimal getVolume() {
        if (this.getLength() == null) {
            return volume;
        }
        if (this.getWidth() == null) {
            return volume;
        }
        if (this.getHigh() == null) {
            return volume;
        }
        volume = new BigDecimal(this.getLength()).multiply(new BigDecimal(this.getWidth()))
            .multiply(new BigDecimal(this.getHigh())).divide(new BigDecimal(1000000)).setScale(2, RoundingMode.HALF_UP);
        return volume;
    }
}
